package cn.xzqwjw.taskmanager.domain.pojo;

import cn.xzqwjw.taskmanager.common.validator.ValidGroupUpdate;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author rush
 */
@TableName(value = "t_article")
@EqualsAndHashCode(callSuper = true)
@Data
public class Article extends Model<Article> implements Serializable {

  @TableField(exist = false)
  private static final long serialVersionUID = 1L;

  @Override
  public Serializable pkVal() {
    return this.id;
  }

  @TableId(value = "id", type = IdType.AUTO)
  @NotNull(message = "id不能为空", groups = ValidGroupUpdate.class)
  private Integer id;

  /**
   * 文章分类id
   */
  private Integer idCategory;

  /**
   * 所属单位
   */
  private Integer idUnit;

  /**
   * 所属部门科室
   */
  private Integer idDepartment;

  /**
   * a：特荐 b：加粗c：推荐f：幻灯h：头条j：跳转p：图片s：滚动，储存类似“a,b,d”这样的数据
   */
  private String symbolShow;

  /**
   * 来源
   */
  private String source;

  /**
   * 文章状态： 0：草稿 1：删除 2：待审 3：已审待签发 4：已签发 5：已生成静态文件
   */
  private String status;

  /**
   * 文章作者
   */
  private String author;

  /**
   * 编辑
   */
  private Integer idEditor;

  /**
   * 审核
   */
  private Integer idChecker;

  /**
   * 签发
   */
  private Integer idSigner;

  /**
   *
   */
  private String tag;

  /**
   * 主标题
   */
  @NotBlank(message = "主标题不能为空！")
  @Length(min = 1, max = 20, message = "label 长度应为1到20")
  private String title;

  /**
   *
   */
  private String titleHead;

  /**
   *
   */
  private String titleSub;

  /**
   *
   */
  private String titleShort;

  /**
   *
   */
  private String urlTitlePic;

  /**
   *
   */
  private String urlTitleVideo;

  /**
   *
   */
  private String urlJump;

  /**
   *
   */
  private String content;

  /**
   *
   */
  private String intro;

  /**
   * 创建时间
   */
  private LocalDateTime dtCreate;

  /**
   * 发布时间
   */
  private LocalDateTime dtPublish;

  /**
   * 删除标记
   */
  private Integer flagDeleted;

  /**
   *
   */
  private Integer weight;

  /**
   * 点击数
   */
  private Integer click;

}